﻿using System.IO;
using System.Net;
using System.Text;
using System.Web;
using System;
using BugManager;

namespace GUI.Services.Other
{

    public class GetDuLieuChungKhoan : IHttpHandler
    {
        private const string Url = "http://solieu7.vcmedia.vn/IndexHandler.ashx";

        public void ProcessRequest(HttpContext context)
        {
            //try
            //{
            //    context.Response.ContentType = "text/plain";
            //    var request = WebRequest.Create(Url);
            //    var response = request.GetResponse();

            //    var stream = response.GetResponseStream();

            //    if (stream != null)
            //    {
            //        var reader = new StreamReader(stream, Encoding.UTF8);
            //        var responseText = reader.ReadToEnd();
            //        reader.Close();
            //        response.Close();

            //        if (!string.IsNullOrEmpty(responseText))
            //        {
            //            context.Response.Write(responseText);
            //        }
            //    }
            //}
            //catch (Exception ex)
            //{
            //    ErrorManager.Log(ex.ToString());
            //}
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}